package com.org.model;

/**
 * PromotionProductCategoryId entity. @author MyEclipse Persistence Tools
 */

public class PromotionProductCategoryId implements java.io.Serializable {

	// Fields

	private Promotion promotion;
	private ProductCategory productCategory;

	// Constructors

	/** default constructor */
	public PromotionProductCategoryId() {
	}

	/** full constructor */
	public PromotionProductCategoryId(Promotion promotion,
			ProductCategory productCategory) {
		this.promotion = promotion;
		this.productCategory = productCategory;
	}

	// Property accessors

	public Promotion getPromotion() {
		return this.promotion;
	}

	public void setPromotion(Promotion promotion) {
		this.promotion = promotion;
	}

	public ProductCategory getProductCategory() {
		return this.productCategory;
	}

	public void setProductCategory(ProductCategory productCategory) {
		this.productCategory = productCategory;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof PromotionProductCategoryId))
			return false;
		PromotionProductCategoryId castOther = (PromotionProductCategoryId) other;

		return ((this.getPromotion() == castOther.getPromotion()) || (this
				.getPromotion() != null
				&& castOther.getPromotion() != null && this.getPromotion()
				.equals(castOther.getPromotion())))
				&& ((this.getProductCategory() == castOther
						.getProductCategory()) || (this.getProductCategory() != null
						&& castOther.getProductCategory() != null && this
						.getProductCategory().equals(
								castOther.getProductCategory())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getPromotion() == null ? 0 : this.getPromotion().hashCode());
		result = 37
				* result
				+ (getProductCategory() == null ? 0 : this.getProductCategory()
						.hashCode());
		return result;
	}

}